<?php

class Form_AdminForm extends Form_Custom_General {

    public function init() {

        $adm_id = $this->createElement('hidden', 'adm_id')
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60"));
        $this->addElement($adm_id);
        
       
        
        $adm_firstname = $this->createElement('text', 'adm_firstname')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->translateObj->translate("admin_required_firstname"))))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60","class"=>"span6","placeholder"=>$this->translateObj->translate("admin_frm_firstname")));
        $this->addElement($adm_firstname);
        
        $adm_lastname = $this->createElement('text', 'adm_lastname')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->translateObj->translate("admin_required_lastname"))))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60","class"=>"span6","placeholder"=>$this->translateObj->translate("admin_frm_lastname")));
        $this->addElement($adm_lastname);
        
       
        $adm_phone = $this->createElement('text', 'adm_phone')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->translateObj->translate("admin_required_phone"))))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60","class"=>"span6","placeholder"=>$this->translateObj->translate("admin_frm_phone")));
        $this->addElement($adm_phone);
        
        
        $lgn_email = $this->createElement('text', 'lgn_email')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->translateObj->translate("admin_required_email"))))
                ->addValidator(new Zend_Validate_EmailAddress())
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                    new Zend_Filter_StringToLower()
                ))
                ->setAttribs(Array("size" => "60","class"=>"span6","placeholder"=>$this->translateObj->translate("admin_frm_email")));
        $lgn_email->getValidator('emailAddress')->setMessage($this->translateObj->translate("admin_required_valid_email"), Zend_Validate_EmailAddress::INVALID_FORMAT);
        $this->addElement($lgn_email);


        

        $lgn_password = $this->createElement('password', 'lgn_password')
               # ->setRequired(TRUE)
               # ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Password should not be blank.')))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "20","class"=>"span6"));
        $this->addElement($lgn_password);

        
        $lgn_confirmpassword = $this->createElement('password', 'lgn_confirmpassword')
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->translateObj->translate("admin_required_password"))))
                ->setAttribs(Array("size" => "20","class"=>"span6"));
        $this->addElement($lgn_confirmpassword);

        $adm_address= $this->createElement('textarea', 'adm_address')
                    ->setRequired(TRUE)
                    ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->translateObj->translate("admin_required_address"))))
                    ->addFilters(array(
                        new Zend_Filter_StringTrim()
                    ))
                    ->setAttribs(Array("size" => "60", "cols" => "50", "rows" => "3","class"=>"span6","placeholder"=>$this->translateObj->translate("admin_frm_address")));
        $this->addElement($adm_address);
        
        $adm_city= $this->createElement('text', 'adm_city')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->translateObj->translate("admin_required_city"))))
                ->addFilters(array(
                    new Zend_Filter_StringTrim()
                ))
                ->setAttribs(Array("size" => "60","class"=>"span6","placeholder"=>$this->translateObj->translate("admin_frm_city")));
        $this->addElement($adm_city);

        

         $adm_state = $this->createElement('text', 'adm_state')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->translateObj->translate("admin_required_state"))))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60","class"=>"span6","placeholder"=>$this->translateObj->translate("admin_frm_state")));
        $this->addElement($adm_state);
        
        $adm_country = $this->createElement('select', 'adm_country')
                ->setRequired(TRUE)
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                    new Zend_Filter_StringToLower()
                ))
                ->setAttribs(Array( "class" => "select2"))
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->translateObj->translate("admin_required_country"))));
        $this->addElement($adm_country);
         
        $adm_zipcode = $this->createElement('text', 'adm_zipcode')
                #->setRequired(TRUE)
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60","class"=>"span6","placeholder"=> $this->translateObj->translate("admin_frm_zipcode")));
        $this->addElement($adm_zipcode);
        
        $lang_id = $this->createElement('select', 'lang_id')
                #->setRequired(TRUE)
                ->setAttribs(Array( "class" => "select2"))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                    new Zend_Filter_StringToLower()
                ));
        
        $this->addElement($lang_id);
        
        $adm_status = $this->createElement('select', 'adm_status')
                ->setRequired(TRUE)
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                    new Zend_Filter_StringToLower()
                ))
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->translateObj->translate("admin_required_status"))));
        $this->addElement($adm_status); 
        
      
        
        
       


        $submit = $this->createElement('submit', 'Save')
                ->setAttribs(Array('title' => "Save changes", 'class'=>"btn-glow primary"))
                 ->setLabel($this->translateObj->translate("frm_save"));
        $this->addElement($submit);


        $reset = $this->createElement('reset', 'Reset')
                ->setAttribs(Array('title' => "Save changes and continue to edit", 'class'=>"btn-glow primary"))
                 ->setLabel($this->translateObj->translate("frm_reset"));
        $this->addElement($reset);
    }

}